package jd.se.register;

import jd.se.common.Utils;
import org.apache.ibatis.session.SqlSession;

public class registerSer {
    public boolean registerADD(registerDto dto){
        SqlSession sqlSession = Utils.openSession();
        try{
            registerDao dao = sqlSession.getMapper(registerDao.class);
            dao.add(dto);//insert into user(u_id,u_name,password,email,phone)values()
            sqlSession.commit();
            return true;
        }catch (Exception e){
            sqlSession.rollback();
            throw new RuntimeException(e);
        }finally {
            sqlSession.close();
        }
    }
}
